#include <iostream>

using namespace std;

typedef long long LL;

const int N = 1e6 + 10;

bool st[N];
int p[N], cnt;
int n;

void get_prime()
{
	for(int i = 2; i <= n; i++)
	{
		if(!st[i]) p[++cnt] = i;
		
		for(int j = 1; 1ll * i * p[j] <= n; j++)
		{
			st[i * p[j]] = true;
			if(i % p[j] == 0) break;
		}
	}
}

int main()
{
	cin >> n;
	
	get_prime();
	
	for(int i = 1; i <= cnt; i++)
	{
		int s = 0;
		for(LL j = p[i]; j <= n; j *= p[i])
		{
			s += n / j;
		}
		cout << p[i] << " " << s << endl;
	}
	return 0;
}
